Page({
    data: {
      value: '',
      search: ''
    },
    onChange(e) {
      this.setData({
        value: e.detail,
      });
    },
    onSearch() {
      Toast('搜索' + this.data.value);
    },
    onClick(a) {
        var that = this; 
    //   Toast('搜索' + this.data.value);
    var search = this.data.value;
    wx.request({
        url: 'http://127.0.0.1/bnstudy/public/index.php/api/v1/search?search=' + search,
        header: {
          'content-type': 'application/json' // 默认值
        },
        success (res) {
          console.log(res.data);
          that.setData({
              search: res.data
          })
        }
      })
      console.log(this.data.search);
      
    },
  });